﻿using blackhouse.WebNemo.Business.Groups;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace blackhouse.StareKino.Web.Contact {
    internal class ContactPlaceCategory {

        #region Properties

        public int CategoryId { get; private set; }
        public string CategoryName { get; private set; }

        #endregion

        #region Constructors

        internal ContactPlaceCategory(GroupRecord categoryRecord) {
            this.CategoryId = categoryRecord.RecordId;
            this.CategoryName = categoryRecord.GetString("category_name");
        }

        #endregion

        #region Methods

        public override bool Equals(object obj) {
            if (obj == null)
                return false;
            ContactPlaceCategory category2 = obj as ContactPlaceCategory;
            if (category2 == null)
                return false;
            return category2.CategoryId == this.CategoryId;
        }

        public override int GetHashCode() {
            return this.CategoryId;
        }

        public static bool operator ==(ContactPlaceCategory a, ContactPlaceCategory b) {
            if (System.Object.ReferenceEquals(a, b)) {
                return true;
            }

            if (((object)a == null) || ((object)b == null)) {
                return false;
            }

            return a.CategoryId == b.CategoryId;
        }

        public static bool operator !=(ContactPlaceCategory a, ContactPlaceCategory b) {
            return !(a == b);
        }

        #endregion

    }
}
